import { initializeGame, Game } from './game-state.js';
import { gameLoop } from '../game-loop.js'; // 添加导入 gameLoop 函数

document.addEventListener('DOMContentLoaded', () => {
    const progressContainer = document.getElementById('progressContainer');
    progressContainer.style.display = 'block';

    initializeGame().then(() => {
        // 所有资源加载完成，开始游戏
        gameLoop(); // 启动游戏循环
    }).catch(error => {
        console.error('Failed to initialize game:', error);
    });
});